﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace WebRamosUC.Models
{
    public class RuleViolation
    {

        public string ErrorMessage { get; private set; }
        public string PropertyName { get; private set; }

        public RuleViolation(string errorMessage)
        {
            ErrorMessage = errorMessage;
        }

        public RuleViolation(string errorMessage, string propertyName)
        {
            ErrorMessage = errorMessage;
            PropertyName = propertyName;
        }
        public IEnumerable<RuleViolation> GetRuleViolations()
        {
            yield return new RuleViolation("Not implented", "foo");
/*
            if (String.IsNullOrEmpty(Title))
                yield return new RuleViolation("Title required", "Title");

            if (String.IsNullOrEmpty(Description))
                yield return new RuleViolation("Description required", "Description");

            if (String.IsNullOrEmpty(HostedBy))
                yield return new RuleViolation("HostedBy required", "HostedBy");

            if (String.IsNullOrEmpty(Address))
                yield return new RuleViolation("Address required", "Address");

            if (String.IsNullOrEmpty(Country))
                yield return new RuleViolation("Country required", "Country");

            if (String.IsNullOrEmpty(ContactPhone))
                yield return new RuleViolation("Phone# required", "ContactPhone");

            if (!PhoneValidator.IsValidNumber(ContactPhone, Country))
                yield return new RuleViolation("Phone# does not match country",
                                               "ContactPhone");

            yield break;*/
        } 
    }
 
    public class CorreoValidador { 
 
     //TODO: left by MAX
    public static bool IsValidemail(string email) { 
        if (email != null) 
            return true; 
        else 
            return false; 
    } 
 
} 


}
